import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;
import java.util.Scanner;

public class _05_AngleUnitConverter {

	public static double convertDegreesToRadians(double degrees) {

		return degrees * Math.PI / 180;
	}

	public static double convertRadiansToDegrees(double radians) {

		return radians * 180 / Math.PI;
	}

	public static void main(String[] args) {

		Locale.setDefault(Locale.ROOT);

		Scanner inputCS = new Scanner(System.in);
		String userInput = inputCS.nextLine();
		inputCS.close();

		String[] splittedInput = userInput.split(" ");

		double result = 0;

		if (splittedInput.length == 2) {

			if (splittedInput[1].equals("deg") == true) {

				result = convertDegreesToRadians(Double.parseDouble(splittedInput[0]));
			}
			else if (splittedInput[1].equals("rad") == true) {

				result = convertRadiansToDegrees(Double.parseDouble(splittedInput[0]));
			}
			else {

				return;
			}
		}
		else {

			return;
		}

		NumberFormat formattingSample = new DecimalFormat("#.######"); // without Locale.ROOT return with comma (",")
		System.out.println(formattingSample.format(result));

		System.out.printf("%.6f", result);
	}
}